import java.util.Vector;

/*自定义一个栈
 * *
 */
class MyStack<T> {
    int index;
    Vector<T> array;

    public MyStack() { //初始化
        index = -1;
        array = new Vector<T>();
    }

    public boolean isEmpty() { //判断为空
        return index == -1 ? true : false;
    }

    public void push(T x) { //入栈
        index++;
        array.add(index, x);
    }

    public T pop() {  //出栈
        T tmp = array.remove(index);
        index--;
        return tmp;
    }

    public void clear() { //清空
        index = -1;
        array.clear();
    }
}